package com.lions;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

/**
 * Testing the module list.
 * @author Brad
 *
 */
public class ModuleList {
	/**
	 * srtuff and things.
	 */
	private com.lions.client.model.ModuleList moduleList;
	/**
	 * stuff an things.
	 */
	private com.lions.client.model.Module testModule;
	/**
	 * 0.
	 */
	private final int zero = 0;
	/**
	 * 1.
	 */
	private final int one = 1;
	/**
	 * 1.
	 */
	/**
	 * 1.
	 */
	private final int nine = 9;
	/**
	 * 1.
	 */
	private final int ten = 10;
	/**
	 * 100.
	 */

	@Test
	public final void testSize() {
		moduleList = new com.lions.client.model.ModuleList();
		for (int i = zero; i < ten; i++) {
			testModule = new com.lions.client.model.Module(zero);
			moduleList.add(testModule);
		}
		assertTrue(moduleList.size() == ten);
	}
	/**
	 * Testing the remove.
	 */
	@Test
	public final void testRemove() {
		moduleList = new com.lions.client.model.ModuleList();
		for (int i = zero; i < ten; i++) {
			testModule = new com.lions.client.model.Module(zero);
			moduleList.add(testModule);
		}
		moduleList.remove(one);
		assertTrue(moduleList.size() == nine);
	}
	/**
	 * Testing the add.
	 */
	@Test
	public final void testAdd() {
		moduleList = new com.lions.client.model.ModuleList();
		for (int i = zero; i < nine; i++) {
			testModule = new com.lions.client.model.Module(zero);
			moduleList.add(testModule);
		}
		testModule = new com.lions.client.model.Module(zero);
		moduleList.add(testModule);
		assertTrue(moduleList.size() == ten);
	}
	/**
	 * Testing the clear.
	 */
	@Test
	public final void testClear() {
		moduleList = new com.lions.client.model.ModuleList();
		for (int i = zero; i < ten; i++) {
			testModule = new com.lions.client.model.Module(zero);
			moduleList.add(testModule);
		}
		moduleList.clear();
		assertTrue(moduleList.size() == zero);
	}
}
